<?php
if(Yii::app()->user->hasFlash('error')) {
    $upgrade_serial_part1 = Yii::app()->user->getFlash('upgrade_serial_part1');
    $upgrade_serial_part2 = Yii::app()->user->getFlash('upgrade_serial_part2');
    $upgrade_serial_part3 = Yii::app()->user->getFlash('upgrade_serial_part3');
    $upgrade_serial_part4 = Yii::app()->user->getFlash('upgrade_serial_part4');
} else {
    $upgrade_serial_part1 = $upgrade_serial_part2 = $upgrade_serial_part3 = $upgrade_serial_part4 = '';
}

$form = $this->beginWidget('CActiveForm', array(
    'id' => 'captcha-form',
    ));
echo $form->errorSummary($model); 
$this->endWidget();
?>
<h1>Upgrade Membership</h1>
<?php
$this->renderPartial('application.modules.member.views.main.info');
?>
<br /><br />
<h1>ID Aktif <?php echo Yii::app()->user->getState('network_mid'); ?></h1>
<div class="add">
    <form action="" method="post" name="admin_form" enctype="multipart/form-data">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr class="title">
                <th colspan="2" style="text-align:left;"><strong>Masukkan Serial dan PIN Upgrade</strong></th>
            </tr>
            <tr>
                <th width="100" valign="top">Nomor Serial</th>
                <td>
                    <input type="text" name="upgrade_serial[1]" value="<?php echo $upgrade_serial_part1; ?>" size="3" maxlength="4" class="text" style="text-align:center; text-transform:uppercase;" /> -
                    <input type="text" name="upgrade_serial[2]" value="<?php echo $upgrade_serial_part2; ?>" size="3" maxlength="4" class="text" style="text-align:center; text-transform:uppercase;" /> -
                    <input type="text" name="upgrade_serial[3]" value="<?php echo $upgrade_serial_part3; ?>" size="3" maxlength="4" class="text" style="text-align:center; text-transform:uppercase;" /> -
                    <input type="text" name="upgrade_serial[4]" value="<?php echo $upgrade_serial_part4; ?>" size="3" maxlength="4" class="text" style="text-align:center; text-transform:uppercase;" />
                </td>
            </tr>
            <tr>
                <th width="100" valign="top">PIN</th>
                <td><input type="password" name="upgrade_pin" value="" size="10" class="text" style="text-align:center;" /></td>
            </tr>
            <tr class="title">
                <th colspan="2" style="text-align:left;"><strong>VALIDASI PIN</strong></th>
            </tr>
            <tr>
                <th>PIN Utama</th>
                <td><input type="password" name="pin" value="" size="10" class="text" /></td>
            </tr>
            <?php if (extension_loaded('gd')): ?>
                <tr class="title">
                    <th colspan="2" style="text-align:left;"><strong>VALIDASI KODE UNIK</strong></th>
                </tr>
                <tr>
                    <th>Kode Unik</th>
                    <td>
                        <div style="float:left; padding-right:10px;"><input type="text" name="captcha_form[verifyCode]" value="" size="10" class="text" /></div>
                        <div style="float:left; padding-top:1px;"><?php $this->widget('CCaptcha'); ?></div>
                        <div style="clear:both;"></div>
                    </td>
                </tr>
            <?php endif; ?>
            <tr>
                <th>&nbsp;</th>
                <td><input type="submit" name="upgrade" value="Proses" class="button" /></td>
            </tr>
        </table>
    </form>
</div>